//客户端程序入口文件

// 引入相关依赖
const { getTimeFromNTPServer } = require('./core')

//运行
getTimeFromNTPServer({
    port: 8088,
    address: 'localhost',
}).then(reply => {
    const { ts, version, cost } = reply
    console.log(`got server time: ${new Date(ts).toLocaleString()}, version:${version}, request cost: ${cost}ms`)
}, err => {
    console.error(err)
})